package work.service.impl;

import work.dao.GoodsDao;
import work.pojo.Goods;
import work.service.GoodsService;

import java.util.List;

public class GoodsServiceImpl implements GoodsService {
    private GoodsDao dao;

    public void setDao(GoodsDao dao) {
        this.dao = dao;
    }

    @Override
    public List<Goods> findNewGoods() {
        return dao.findNewGoods();
    }

    @Override
    public List<Goods> findHotGoods() {
        return dao.findHotGoods();
    }

    @Override
    public List<Goods> orderBySaleNums(int num) {
        return dao.findByPages(1);
    }

    @Override
    public Goods detail(int gid) {
        return dao.findById(gid);
    }
}
